<template>

  <section class="index-swiper">
    <div class="swiper_img">
      <swiper :options="swiperOption" ref="mySwiperA">
        <!-- 幻灯内容 -->
        <swiper-slide v-for="(item,index) in swiperArr" :key="index">
          <img :src="item.image" alt="">
        </swiper-slide>
        <!-- 以下控件元素均为可选 -->
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </section>

</template>

<script>
import axios from 'axios';
  export default  {
    name: 'index-swiper',
    props: [],
    created() {
      axios.get("http://vueshop.glbuys.com/api/home/index/slide?token=1ec949a15fb709370f").then((res)=>{
        // console.log("轮播",res.data.data)
        this.swiperArr = res.data.data;
      })
    },
    data() {
      return {
        swiperOption: {
          autoplay: true,
          pagination: {
            el: '.swiper-pagination'//分页器,
          }
        },
        swiperArr:[],
      }
    },
    methods: {

    },
    computed: {

    }
}
</script>

<style scoped>
  .swiper_img{
    height: 3.63rem;
    z-index:-1;
  }
  .swiper_img img{
    width: 100%;
  }
</style>
